﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class RigidbodyFollow : MonoBehaviour
{
    public Transform obj;
    public Transform target;
    public bool fixedUpdate;
    public bool update;
    private void Update()
    {
        if (update) TransFollow();
    }
    void FixedUpdate()
    {
        if (fixedUpdate) RigidFollow();
    }
    void TransFollow()
    {
        obj.position = target.position;
    }
    void RigidFollow()
    {
        obj.GetComponent<Rigidbody>().MovePosition(target.position);
    }
}
